Previous Book Contents Book Index Next

Inside Macintosh: Programming With JManager /
Chapter 2 - JManager Reference / JManager Functions
Abstract Window Toolkit Control Functions /


JMExecJNIMethodInContext

Executes a nonstatic Java method in a given AWT context thread using the Java Native Interface (JNI).

OSStatus JMExecJNIMethodInContext (
                     JMAWTContextRef context, 
                     JNIEnv* env, 
                     jobject objref, 
                     jmethodID methodID, 
                     UInt32 argCount, 
                     jvalue args[]);
context
The AWT context in whose thread you want the method to execute.
env
A pointer to the current JNIEnv data structure.
objref
A pointer to the Java object that contains the method you want to call.
methodID
The ID of the method.
argCount
The number of arguments in the method.
args[]
The argument list.
function result
A result code; see "JManager Result Codes".
DISCUSSION
Before calling this function, you must call the JMGetCurrentEnv function to get the JNIEnv pointer.

If you want to execute a static Java method (that is, one that is not local to an object) using the JNI, you must call the JMExecJNIStaticMethodInContext function instead.

You can find documentation on the Java Native Interface (JNI) at the Web page

http://java.sun.com/


Previous Book Contents Book Index Next

© Apple Computer, Inc.
10 DEC 1997